<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 店铺保证金订单 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\StoreSuretyOrder.name", default="fa_store_surety_order"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\StoreSuretyOrder.poolName"))
 * @DDL(sql="CREATE TABLE `fa_store_surety_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) DEFAULT NULL COMMENT '用户id',
  `store_id` int(10) DEFAULT NULL COMMENT '店铺id',
  `money` decimal(10,2) DEFAULT NULL COMMENT '支付金额',
  `pay_time` int(10) DEFAULT NULL COMMENT '支付时间',
  `pay_status` enum('1','2','3','4','5','6','7','8','9') DEFAULT '1' COMMENT '支付状态:1=待支付,2=已支付,3=已退款,4=已超时',
  `order` varchar(50) DEFAULT NULL COMMENT '订单号',
  `time` int(10) DEFAULT NULL COMMENT '创建时间',
  `pay_type` enum('1','2','3','9') DEFAULT '1' COMMENT '支付类型:1=微信,2=支付宝,3=钱包,9=其他',
  `status` enum('1','2') DEFAULT '1' COMMENT '类型:1=普通保证金,2=活动保证金',
  `pay_money` int(10) DEFAULT NULL COMMENT '实际支付（分）',
  `pay_openid` varchar(32) DEFAULT NULL COMMENT '支付者openid',
  `ps` varchar(255) DEFAULT NULL COMMENT '备注',
  `price` decimal(10,2) DEFAULT NULL COMMENT '价格',
  `num` int(10) unsigned DEFAULT '1' COMMENT '第几次',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='店铺保证金订单'", decode="")
 *
 * @property int|null $id 
 * @property int|null $userId 用户id
 * @property int|null $storeId 店铺id
 * @property string|float|int|null $money 支付金额
 * @property int|null $payTime 支付时间
 * @property string|null $payStatus 支付状态:1=待支付,2=已支付,3=已退款,4=已超时
 * @property string|null $order 订单号
 * @property int|null $time 创建时间
 * @property string|null $payType 支付类型:1=微信,2=支付宝,3=钱包,9=其他
 * @property string|null $status 类型:1=普通保证金,2=活动保证金
 * @property int|null $payMoney 实际支付（分）
 * @property string|null $payOpenid 支付者openid
 * @property string|null $ps 备注
 * @property string|float|int|null $price 价格
 * @property int|null $num 第几次
 */
abstract class StoreSuretyOrderBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 用户id.
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $userId = NULL;

    /**
     * 获取 userId - 用户id.
     *
     * @return int|null
     */
    public function getUserId(): ?int
    {
        return $this->userId;
    }

    /**
     * 赋值 userId - 用户id.
     * @param int|null $userId user_id
     * @return static
     */
    public function setUserId($userId)
    {
        $this->userId = null === $userId ? null : (int)$userId;
        return $this;
    }

    /**
     * 店铺id.
     * store_id
     * @Column(name="store_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $storeId = NULL;

    /**
     * 获取 storeId - 店铺id.
     *
     * @return int|null
     */
    public function getStoreId(): ?int
    {
        return $this->storeId;
    }

    /**
     * 赋值 storeId - 店铺id.
     * @param int|null $storeId store_id
     * @return static
     */
    public function setStoreId($storeId)
    {
        $this->storeId = null === $storeId ? null : (int)$storeId;
        return $this;
    }

    /**
     * 支付金额.
     * money
     * @Column(name="money", type="decimal", length=10, accuracy=2, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $money = NULL;

    /**
     * 获取 money - 支付金额.
     *
     * @return string|float|int|null
     */
    public function getMoney()
    {
        return $this->money;
    }

    /**
     * 赋值 money - 支付金额.
     * @param string|float|int|null $money money
     * @return static
     */
    public function setMoney($money)
    {
        $this->money = null === $money ? null : $money;
        return $this;
    }

    /**
     * 支付时间.
     * pay_time
     * @Column(name="pay_time", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $payTime = NULL;

    /**
     * 获取 payTime - 支付时间.
     *
     * @return int|null
     */
    public function getPayTime(): ?int
    {
        return $this->payTime;
    }

    /**
     * 赋值 payTime - 支付时间.
     * @param int|null $payTime pay_time
     * @return static
     */
    public function setPayTime($payTime)
    {
        $this->payTime = null === $payTime ? null : (int)$payTime;
        return $this;
    }

    /**
     * 支付状态:1=待支付,2=已支付,3=已退款,4=已超时.
     * pay_status
     * @Column(name="pay_status", type="enum", length=0, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $payStatus = '1';

    /**
     * 获取 payStatus - 支付状态:1=待支付,2=已支付,3=已退款,4=已超时.
     *
     * @return string|null
     */
    public function getPayStatus(): ?string
    {
        return $this->payStatus;
    }

    /**
     * 赋值 payStatus - 支付状态:1=待支付,2=已支付,3=已退款,4=已超时.
     * @param string|null $payStatus pay_status
     * @return static
     */
    public function setPayStatus($payStatus)
    {
        $this->payStatus = null === $payStatus ? null : (string)$payStatus;
        return $this;
    }

    /**
     * 订单号.
     * order
     * @Column(name="order", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $order = NULL;

    /**
     * 获取 order - 订单号.
     *
     * @return string|null
     */
    public function getOrder(): ?string
    {
        return $this->order;
    }

    /**
     * 赋值 order - 订单号.
     * @param string|null $order order
     * @return static
     */
    public function setOrder($order)
    {
        $this->order = null === $order ? null : (string)$order;
        return $this;
    }

    /**
     * 创建时间.
     * time
     * @Column(name="time", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $time = NULL;

    /**
     * 获取 time - 创建时间.
     *
     * @return int|null
     */
    public function getTime(): ?int
    {
        return $this->time;
    }

    /**
     * 赋值 time - 创建时间.
     * @param int|null $time time
     * @return static
     */
    public function setTime($time)
    {
        $this->time = null === $time ? null : (int)$time;
        return $this;
    }

    /**
     * 支付类型:1=微信,2=支付宝,3=钱包,9=其他.
     * pay_type
     * @Column(name="pay_type", type="enum", length=0, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $payType = '1';

    /**
     * 获取 payType - 支付类型:1=微信,2=支付宝,3=钱包,9=其他.
     *
     * @return string|null
     */
    public function getPayType(): ?string
    {
        return $this->payType;
    }

    /**
     * 赋值 payType - 支付类型:1=微信,2=支付宝,3=钱包,9=其他.
     * @param string|null $payType pay_type
     * @return static
     */
    public function setPayType($payType)
    {
        $this->payType = null === $payType ? null : (string)$payType;
        return $this;
    }

    /**
     * 类型:1=普通保证金,2=活动保证金.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = '1';

    /**
     * 获取 status - 类型:1=普通保证金,2=活动保证金.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 类型:1=普通保证金,2=活动保证金.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

    /**
     * 实际支付（分）.
     * pay_money
     * @Column(name="pay_money", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $payMoney = NULL;

    /**
     * 获取 payMoney - 实际支付（分）.
     *
     * @return int|null
     */
    public function getPayMoney(): ?int
    {
        return $this->payMoney;
    }

    /**
     * 赋值 payMoney - 实际支付（分）.
     * @param int|null $payMoney pay_money
     * @return static
     */
    public function setPayMoney($payMoney)
    {
        $this->payMoney = null === $payMoney ? null : (int)$payMoney;
        return $this;
    }

    /**
     * 支付者openid.
     * pay_openid
     * @Column(name="pay_openid", type="varchar", length=32, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $payOpenid = NULL;

    /**
     * 获取 payOpenid - 支付者openid.
     *
     * @return string|null
     */
    public function getPayOpenid(): ?string
    {
        return $this->payOpenid;
    }

    /**
     * 赋值 payOpenid - 支付者openid.
     * @param string|null $payOpenid pay_openid
     * @return static
     */
    public function setPayOpenid($payOpenid)
    {
        $this->payOpenid = null === $payOpenid ? null : (string)$payOpenid;
        return $this;
    }

    /**
     * 备注.
     * ps
     * @Column(name="ps", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $ps = NULL;

    /**
     * 获取 ps - 备注.
     *
     * @return string|null
     */
    public function getPs(): ?string
    {
        return $this->ps;
    }

    /**
     * 赋值 ps - 备注.
     * @param string|null $ps ps
     * @return static
     */
    public function setPs($ps)
    {
        $this->ps = null === $ps ? null : (string)$ps;
        return $this;
    }

    /**
     * 价格.
     * price
     * @Column(name="price", type="decimal", length=10, accuracy=2, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $price = NULL;

    /**
     * 获取 price - 价格.
     *
     * @return string|float|int|null
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * 赋值 price - 价格.
     * @param string|float|int|null $price price
     * @return static
     */
    public function setPrice($price)
    {
        $this->price = null === $price ? null : $price;
        return $this;
    }

    /**
     * 第几次.
     * num
     * @Column(name="num", type="int", length=10, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $num = 1;

    /**
     * 获取 num - 第几次.
     *
     * @return int|null
     */
    public function getNum(): ?int
    {
        return $this->num;
    }

    /**
     * 赋值 num - 第几次.
     * @param int|null $num num
     * @return static
     */
    public function setNum($num)
    {
        $this->num = null === $num ? null : (int)$num;
        return $this;
    }

}
